<template>
  <div>
    <!-- 主体部分 -->
    <section class="main">
      <input id="toggle-all" class="toggle-all" type="checkbox"  />
      <label for="toggle-all">111</label>
      <ul class="todo-list">
        <!-- 当任务已完成，可以给 li 加上 completed 类，会让元素加上删除线 -->
        <li :class="{completed: item.isDone}" v-for="item in list" :key="item.id" >
          <div class="view">
            <input class="toggle" type="checkbox" :checked='item.isDone' @change="shuang(item.id)" />
            <label>{{item.name}}</label>
            <button class="destroy" @click="shan(item.id)"></button>
          </div>
        </li>
      </ul>
    </section>
  </div>
</template>

<script>
export default {
  name: 'ABody',
  props: {
    list:{
      type:Array,
      require:true
    }
  },
  components: {},
  data () {
    return {
      faly:false,
    }
  },
  methods: {
    shan(id){
      this.$emit('shan',id)
    },
    shuang(id){
      this.$emit('shuang',id)
    }
  },
  mounted () {},
  watch: {},
  computed: {},
  filters: {}
}
</script>

<style scoped lang="less"></style>
